﻿<!DOCTYPE html>
<html>
<head>
<title>个人中心</title>
<meta name="Keywords" content="关键字">
<meta name="Description" content="内容">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="telephone=no, address=no" name="format-detection">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/style.css" media="all"> 
<script type="text/javascript" src="__PUBLIC__/home/js/jquery-1.9.1.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/home/js/size.js"></script>
</head>
<body>
<div class="personaltop">
    <div class="personalleft">
        <div class="namebox">
            <div class="name">
                    <h3>{$data['nickname']}</h3>
                    <!-- <div class="en">lixin</div> -->
            </div>
            <div class="ewm">
                <img src="__PUBLIC__/home/images/ico-ewm.png" alt="">
            </div>
        </div>
        <div class="zw">
            <if condition="$data['role'] eq 2">
            华南世茂普通经办人
            <elseif condition="$data['role'] eq 1" />
            华南世茂高级经办人
            <else/>
            位置级别
            </if>
        </div>
    </div>
    <div class="personalright">
        <div class="img">
            <if condition="empty($data['headimg']) neq true">
            <img src="{$data['headimg']}" alt="">
            <else/>
            <img src="__PUBLIC__/home/images/tx.jpg" alt="">
            </if>
        </div>
    </div>
</div>
<div class="modifylist">
   <ul>
       <li><div class="ico ico-p"></div><div class="t">姓名：</div><div class="intxt"><input name="nickname" type="text" readonly="readonly" value="{$data['nickname']}"></div></li>
       <li><div class="ico ico-t"></div><div class="t">电话：</div><div class="intxt"><input name="mobile" type="text" value="{$data['mobile']}"></div></li>
       <li><div class="ico ico-y"></div><div class="t">邮件：</div><div class="intxt"><input name="email" type="text" value="{$data['email']}"></div></li>
   </ul>
   <div class="btnbox"><input name="" type="button" value="保存信息" class="btn"></div>
</div>
<include file="Public/footer">
</body>
</html>

<script type="text/javascript">
    $(function(){
        $('.btnbox').click(function(){
            var nickname = $('input[name="nickname"]').val();
            var mobile = $('input[name="mobile"]').val();
            var email = $('input[name="email"]').val();

            //console.log(nickname);return;

            $.ajax({
                url :  "{:U('User/update')}",
                type : 'post',
                data : {
                    'nickname' : nickname,
                    'mobile' : mobile,
                    'userId' : {$userId},
                    'email' : email
                },
                dataType : 'json',
                success : function (data, status) {
                    console.log(data)
                    if(data.status){
                        location.href = "/Home/Index/showMine";
                    }else{
                        alert(data.info);
                    }
                },
                fail : function (err, status) {
                    console.log(err)
                }
            })
        })
        
    })
</script>